﻿using star_questionnair.Models;

namespace star_questionnair.Services;

public interface IAnswerService
{
    /// <summary>
    /// 新增答案
    /// </summary>
    void AddAnswer(Answer answer);

    /// <summary>
    /// 根据ID删除答案
    /// </summary>
    void DeleteAnswerById(int id);

    /// <summary>
    /// 批量删除答案
    /// </summary>
    void DeleteAnswersByIds(List<int> ids);

    /// <summary>
    /// 更新答案
    /// </summary>
    void UpdateAnswer(Answer answer);

    /// <summary>
    /// 根据ID获取答案
    /// </summary>
    Answer GetAnswerById(int id);

    /// <summary>
    /// 获取所有符合条件的答案
    /// </summary>
    List<Answer> GetAllAnswers(Answer filter);

    /// <summary>
    /// 根据问题ID获取所有答案
    /// </summary>
    List<Answer> GetAnswersByQuestionId(int questionId);

    /// <summary>
    /// 根据选项ID获取所有答案
    /// </summary>
    List<Answer> GetAnswersByOptionId(int optionId);

    /// <summary>
    /// 根据答案获取关联的用户
    /// </summary>
    User GetUserByAnswer(Answer answer);

    /// <summary>
    /// 根据答案获取关联的回答
    /// </summary>
    Response GetResponseByAnswer(Answer answer);
    Task<List<Answer>> GetAnswerByResponseAndQuestionAsync(int responseId, int questionId);
}